﻿@model IEnumerable<Developer.Entity.Borrowings>
@{
    Layout = null;
    var i = 1;
}

<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="~/Content/UI/css/mui.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="~/Content/UI/css/mdui.min.css" />
    <style>
        h5 {
            margin-bottom: 10px;
        }

        img {
            width: 50%;
            float: left;
        }

        .detail {
            width: 45%;
            float: left;
            margin-left: 5%;
        }
    </style>
</head>

<body>
    <header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title">历史纪录</h1>
    </header>

    <div class="mui-content">
        @if (Model.Count() == 0)
        {
            <div class="mui-content" style="padding-bottom: 100px;">
                <h4 class="mdui-text-center" style="margin-top: 100px;">当前没有借书记录哦~</h4>
            </div>
        }
        else
        {
                <div class="mdui-table-fluid">
                    <table class="mdui-table mdui-table-hoverable">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>书名</th>
                                <th>作者</th>
                                <th>借阅时间</th>
                                <th>状态</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach(var item in Model.OrderBy(a => a.ReturnTime))
                            {
                                <tr>
                                    <td>@(i++)</td>
                                    <td>@item.Books.Name</td>
                                    <td>@item.Books.Author</td>
                                    <td>@item.CreateTime</td>
                                    <td>@(item.ReturnTime == null ? "未归还" : "已归还")</td>
                                </tr>

                            }
                            
                        </tbody>
                    </table>
                </div>


                }

            </div>

    <script src="~/Content/UI/js/mui.min.js"></script>
    <script type="text/javascript" src="~/Content/UI/js/mdui.min.js"></script>
    <script type="text/javascript">
			mui.init()
    </script>
</body>

</html>
